
import { Button, Drawer } from 'antd';
import ProDescriptions from '@ant-design/pro-descriptions';

function Description(props: {
  showDetail: boolean;
  setCurrentRow: any;
  setShowDetail: any;
  currentRow: any;
  columns: any[];
  isEdit?: boolean;
  [key: string]: any;
}){
  const { showDetail, setCurrentRow, setShowDetail, currentRow, columns } = props;

  return (
    <Drawer
        width={600}
        visible={showDetail}
        onClose={() => {
          setCurrentRow(undefined);
          setShowDetail(false);
        }}
        closable={false}
        zIndex={1000}
      >
        {currentRow?.showName && (
          <ProDescriptions
            column={2}
            title={currentRow?.showName}
            request={async () => ({
              data: currentRow || {},
            })}
            params={{
              id: currentRow?.showName,
            }}
            columns={columns}
          >
            <ProDescriptions.Item label="文本" valueType="option">
              <Button key="primary" type="primary" onClick={() => setShowDetail(false)}>
                取消
              </Button>
            </ProDescriptions.Item>
          </ProDescriptions>
        )}
      </Drawer>


  );
}

export default Description;
